<?php
if (!defined('ZAZA')) exit('No direct script access allowed');
/**
 * @copyright     ZaZa Group
 * @author        Sir Doan
 */

class Page
{
    public static $current = false;
    public $data = false;
    function __construct()
    {                           
        Page::$current = &$this;  
        db()->query('SELECT page.pageid,page.name,page.status,page.type,module.moduleid,module.gameid,module.name as module_name,module.status as module_status
                    FROM pages as page
                    LEFT JOIN modules as module ON(page.pageid = module.pageid)
                    WHERE page.name = "'. Obj()->get('fnc') .'" AND page.status = 1 AND type = '. (substr(Obj()->get('fnc'), 0, 5) == ADMIN_PATH ? '1' : '0') .' AND module.gameid = '. Obj()->get('gameid', 'int', 0) .'
                    LIMIT 0,1');
        $page = db()->fetch();  
        // Check isset page
        if(!$page) Url::error('Không tồn tại trang này!');
        else Page::$current->data = $page;   
    }  
}       

// Initialize Page
Page::$current = new Page();
?>
